<?php /* Smarty version Smarty-3.0.7, created on 2017-05-31 15:45:23
         compiled from "C:\wamp\www\gongzhonghao.yuanfenba.net/modules/admin/tpl/picwx/list-pic.tpl" */ ?>
<?php /*%%SmartyHeaderCode:12030592e749336a654-59940918%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '1af9f31f37a902c49670f1787b0deb80b60dc9c4' => 
    array (
      0 => 'C:\\wamp\\www\\gongzhonghao.yuanfenba.net/modules/admin/tpl/picwx/list-pic.tpl',
      1 => 1496215565,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '12030592e749336a654-59940918',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<?php $_template = new Smarty_Internal_Template('header.tpl', $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
 echo $_template->getRenderedTemplate();?><?php unset($_template);?>
<style>
    tbody td {
        text-align: center;
    }
    tbody .summary td {
        background: #ddd;
        color: red;
    }
    #preview {
        position: absolute;
        border: 1px solid #ccc;
        background: #333;
        padding: 5px;
        display: none;
        color: #fff;
    }
</style>
<form method="get" action="" class="form-inline">
    <table class="fTable">
        <tbody>
        <tr>
            <th>文章id</th>
            <td style="width: 150px;">
                <input name="article_id" value="<?php echo $_GET['article_id'];?>
" style="width: 140px;" type="text">
            </td>
            <th>文章标题</th>
            <td style="width: 150px;">
                <input name="title" value="<?php echo $_GET['title'];?>
" style="width: 140px;" type="text">
            </td>
            <th>公众号:</th>
            <td style="width: 150px;">
                <select id="wid" name="wid" onblur="articleData()">
                    <option <?php if ($_smarty_tpl->getVariable('data')->value['wid']==0){?>selected<?php }?> value="0">请选择对应的公众号</option>
                    <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = Service_Gzh::gzh(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                        <option  <?php if ($_GET['wid']==$_smarty_tpl->tpl_vars['v']->value['wid']){?>selected<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['v']->value['wid'];?>
"><?php echo $_smarty_tpl->tpl_vars['v']->value['wid'];?>
-<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
<?php $_tmp1=ob_GET_clean();?><?php echo $_tmp1;?>
</option>
                    <?php }} ?>
                </select>
            </td>
            <th>公众号名称</th>
            <td style="width: 150px;">
                <input name="gzh_name" value="<?php echo $_GET['gzh_name'];?>
" style="width: 140px;" type="text">
            </td>

            <td>
                <button class="btn btn-sm btn-default" type="submit">查找</button>&nbsp;&nbsp;
                <a class="btn btn-success btn-sm"  href="/admin/PicWx/articleModify">添加列表页图片</a>
            </td>
        </tr>
        </tbody>
    </table>
</form>
<div class="clearfix" style="height:30px;"></div>

<table class="fTable" style="width: 100%">
    <thead>
    <tr>
        <th >ID</th>
        <th >标题</th>
        <th >所属公众号</th>
        <th >所属菜单</th>
        <th >类型</th>
        <th >列表图片</th>
        <th >缩略图</th>
        <th >图片数量</th>
        <th >日期</th>
        <th >操作</th>
    </tr>
    </thead>
    <tbody>
    <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('list')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
?>
        <tr>
            <td><?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</td>
            <td>
                <?php if ($_smarty_tpl->tpl_vars['item']->value['pid']==0){?>
                    <?php echo $_smarty_tpl->tpl_vars['item']->value['mname'];?>

                <?php }else{ ?>
                <?php $_smarty_tpl->tpl_vars['m'] = new Smarty_variable(Service_Gzh::menuDetail($_smarty_tpl->tpl_vars['item']->value['pid']), null, null);?>
                    <?php echo $_smarty_tpl->getVariable('m')->value['mname'];?>
---<?php echo $_smarty_tpl->tpl_vars['item']->value['mname'];?>

                <?php }?>

            </td>
            <td>
                <?php if ($_smarty_tpl->tpl_vars['item']->value['type']==1){?>小图<?php }?>
                <?php if ($_smarty_tpl->tpl_vars['item']->value['type']==2){?>大图<?php }?>
            </td>
            <td>
                <a  href="<?php echo Service_Attach::getInstance()->getThumbUrl($_smarty_tpl->tpl_vars['item']->value['bg_img']);?>
" target="_blank" class="preview"
                    rel="<?php echo Service_Attach::getInstance()->getThumbUrl($_smarty_tpl->tpl_vars['item']->value['bg_img'],192,192);?>
">
                    <img src="<?php echo Service_Attach::getInstance()->getThumbUrl($_smarty_tpl->tpl_vars['item']->value['bg_img'],150,150);?>
" style="width: 40px;" />
                </a>
            </td>
            <td>
                <a  href="<?php echo Service_Attach::getInstance()->getThumbUrl($_smarty_tpl->tpl_vars['item']->value['img_thumb']);?>
" target="_blank" class="preview"
                    rel="<?php echo Service_Attach::getInstance()->getThumbUrl($_smarty_tpl->tpl_vars['item']->value['img_thumb'],192,192);?>
">
                    <img src="<?php echo Service_Attach::getInstance()->getThumbUrl($_smarty_tpl->tpl_vars['item']->value['img_thumb'],150,150);?>
" style="width: 40px;" />
                </a>
            </td>
            <td><?php echo $_smarty_tpl->tpl_vars['item']->value['count_pic'];?>
</td>

            <td><?php echo $_smarty_tpl->tpl_vars['item']->value['create_time'];?>
</td>
            <td>
                <a href="/admin/PicWx/articleModify?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" >编辑</a>
                <a onclick="delete_union(<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
)" href="javascript:;">删除</a>
            </td>
        </tr>
    <?php }} ?>
    </tbody>
</table>

    <script>
        $(document).ready(function () {
            imagePreview();
        });
        this.imagePreview = function () {
            /* CONFIG */

            xOffset = 10;
            yOffset = 30;

            // these 2 variable determine popup's distance from the cursor
            // you might want to adjust to get the right result

            /* END CONFIG */
            $("a.preview").hover(function (e) {
                    this.t = this.title;
                    this.title = "";
                    var c = (this.t != "") ? "<br/>" + this.t : "";
                    $("body").append("<div id='preview'><img src='" + this.rel + "' alt='Image preview' />" + c + "</div>");
                    $("#preview")
                        .css("top", (e.pageY - xOffset) + "px")
                        .css("left", (e.pageX + yOffset) + "px")
                        .fadeIn("fast");
                },
                function () {
                    this.title = this.t;
                    $("#preview").remove();
                });
            $("a.preview").mousemove(function (e) {
                $("#preview")
                    .css("top", (e.pageY - xOffset) + "px")
                    .css("left", (e.pageX + yOffset) + "px");
            });
        };

        function delete_union(id){
            var flag = confirm('删除记录，是否继续？');
            if(flag){
                location.href="/admin/PicWx/deleteArticle?id="+id;
            }
        }

    </script>

<?php $_template = new Smarty_Internal_Template("pager.tpl", $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
 echo $_template->getRenderedTemplate();?><?php unset($_template);?>
<?php $_template = new Smarty_Internal_Template('footer.tpl', $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
 echo $_template->getRenderedTemplate();?><?php unset($_template);?>